/*
day94
2019.11.30
*/
#include<iostream>
#include<string>
#include<map>
#include<vector>

using namespace std;

struct TreeNode{
	int val;
	struct TreeNode *left;
	struct TreeNode *right;
};


class Solution {
public:
	string help(struct TreeNode *root,map<string,int> &map,vector<struct TreeNode *> &vec)
	{
		if(!root) return " ";
		string cur=to_string(root->val)+","+help(root->left,map,vec)+","+help(root->right,map,vec);
		map[cur]++;
		if(map[cur]==2) vec.push_back(root);
		
		return cur;
	}
	
    vector<TreeNode*> findDuplicateSubtrees(TreeNode* root) 
	{
        vector<TreeNode *> vec;
        map<string,int> map;
        help(root,map,vec); 
        return vec;
    }
};


int main()
{
	string str="";
	
	str+=to_string(1);
	cout<<str<<endl;
	return 0;
}
